/* eslint-disable indent */
import request from '@/utils/request'

// 获取权限列表
export function getPermissionList(params) {
    return request({
        url: '/sys/permission',
        params
    })
}
/**
 * 新增权限
 * @param {*} data
 * @returns Promise
 */
export function addPermission(data, b) {
    return request({
        url: '/sys/permission',
        method: 'post',
        data
    })
}

// 更新权限
export function updatePermission(data) {
    return request({
        url: `/sys/permission/${data.id}`,
        method: 'put',
        data
    })
}

// 删除权限 id:权限点ID
export function delPermission(id) {
    return request({
        url: `/sys/permission/${id}`,
        method: 'delete'
    })
}

// 获取权限详情 id:权限点ID
export function getPermissionDetail(id) {
    return request({
            url: `/sys/permission/${id}`
        })
        // eslint-disable-next-line eol-last
}